package com.csj.mvvmtest.ui.first.adapter

import androidx.fragment.app.FragmentActivity
import com.bumptech.glide.Glide
import com.csj.mvvm.ui.base.BaseAdapter
import com.csj.mvvm.utils.ToastUtil
import com.csj.mvvm.widget.clicks
import com.csj.mvvmtest.bean.ArticleBean
import com.csj.mvvmtest.databinding.ItemArticleBinding


class ArticleListAdapter(context: FragmentActivity, listDatas: ArrayList<ArticleBean>) :
    BaseAdapter<ItemArticleBinding, ArticleBean>(context, listDatas) {

    override fun convert(v: ItemArticleBinding, t: ArticleBean, position: Int) {
        Glide.with(mContext).load(t.envelopePic).into(v.ivCover)
        v.tvTitle.text = t.title
        v.tvDes.text = t.desc
        v.tvDes.clicks { ToastUtil.showToast("haha") }
    }

}
